#ifndef _CRANE_ONKEY_H_
#define _CRANE_ONKEY_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "lv_drv_conf.h"
#include "lvgl/src/lv_hal/lv_hal_indev.h"

enum {
    KEY_EVENT_NONE,
    KEY_EVENT_CLICK,
    KEY_EVENT_LONG_PRESS,
    KEY_EVENT_POWER_ON,
    KEY_EVENT_RELEASE,
    KEY_EVENT_PRESS,
    KEY_EVENT_END,
};

struct keypad_param {
    lv_indev_data_t data;
    uint8_t key_event;
};

#ifdef USE_ONKEY_HISR
#include "../../board.h"

void onkey_init(void);
void handle_onkey(struct keypad_param *val);
int onkey_queue_empty(void);
void onkey_suspend(void *arg);
void onkey_resume(void *arg);

#endif /* USE_ONKEY_HISR */

#if USE_TOUCH_TRACKER
void touch_tracker_onkey(void);
#endif

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif
